Skip to content

fix: respect multiSelect in checkbox and row keyboard selection#2573

Merged
ghiscoding merged 6 commits into
masterfrom
bugfix/row-selection-multiselect-false
May 8, 2026
Merged

fix: respect multiSelect in checkbox and row keyboard selection#2573
ghiscoding merged 6 commits into
masterfrom
bugfix/row-selection-multiselect-false

Conversation

@ghiscoding

@ghiscoding ghiscoding commented May 7, 2026

Copy link
Copy Markdown
Owner

fixes an old issue opened in SlickGrid (6pac) project: 6pac/SlickGrid#345

vibe coded a fix with Copilot

Summary

This change fixes checkbox row selection behavior so it correctly follows the grid multiSelect option.

  • When multiSelect is true:
    • Checkbox clicks keep existing toggle behavior (add/remove row from selection).
  • When multiSelect is false:
    • Checkbox clicks enforce single selection (only one row selected at a time).
    • Clicking an already selected checkbox clears selection.
  • Active cell is still updated after checkbox toggle to preserve keyboard/editor flow.
  • Row-mode Shift+Arrow selection in the hybrid selection model now clamps to a single row when multiSelect is false.

Root cause

Checkbox toggling previously always used additive selection logic, even when multiSelect was disabled.
Also, row keyboard range selection had logic gaps for single-select mode in the merged hybrid selection model.

Repro steps (before fix)

  1. Open a grid with checkbox selector enabled and set multiSelect to false.
  2. Click checkbox on row A.
  3. Click checkbox on row B.
  4. Observe both rows can remain selected (incorrect for single-select mode).

Optional keyboard repro:

  1. Keep multiSelect false.
  2. Enter row selection mode.
  3. Use Shift+Arrow Up/Down.
  4. Observe range-style behavior instead of single-row behavior.

Expected behavior (after fix)

  1. With multiSelect false, selecting row B after row A keeps only row B selected.
  2. Clicking an already selected checkbox clears selection.
  3. Shift+Arrow in row mode keeps selection to one row.
  4. Active cell remains synchronized on checkbox toggle.

What was changed

  • Updated checkbox toggle logic to branch on multiSelect :
    • true: preserve existing toggle semantics.
    • false: enforce [row] or [] selection only.
  • Kept active-cell update after toggle.
  • Updated hybrid row keyboard handling so Shift+Arrow still works, but clamps to a single row when multiSelect is false.
  • Added/updated unit tests for:
    • checkbox single-select behavior
    • keyboard single-select clamp behavior

Validation

  • Unit tests pass.
  • Coverage checks pass.
  • Cypress run in progress by maintainer.

I'll need to add a note warning on the next release:

⚠️ Breaking Change - multiSelect Option Now Properly Enforced

The multiSelect option is now properly respected. If you previously set multiSelect: false expecting it to work differently, this will now correctly enforce single-row-only selection. To allow multiple row selection while preventing the currently-active row from being automatically selected during navigation, use selectionOptions.selectActiveRow: false instead (keeping multiSelect at its default true).


This makes it clearer that selectActiveRow: false is specifically about navigation behavior (not auto-selecting as you arrow through rows), whereas multiSelect is about how many rows you can select in total.

@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (15e3ca0) to head (07962af).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2573   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         196      196           
  Lines       25275    25277    +2     
  Branches     8925     8923    -2     
=======================================
+ Hits        25275    25277    +2     
Flag Coverage Δ
angular 100.0% <ø> (ø)
universal 100.0% <100.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented May 7, 2026

Copy link
Copy Markdown
angular-slickgrid

npm i https://pkg.pr.new/angular-slickgrid@2573

aurelia-slickgrid

npm i https://pkg.pr.new/aurelia-slickgrid@2573

slickgrid-react

npm i https://pkg.pr.new/slickgrid-react@2573

slickgrid-vue

npm i https://pkg.pr.new/slickgrid-vue@2573

@slickgrid-universal/angular-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/angular-row-detail-plugin@2573

@slickgrid-universal/aurelia-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/aurelia-row-detail-plugin@2573

@slickgrid-universal/react-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/react-row-detail-plugin@2573

@slickgrid-universal/vue-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/vue-row-detail-plugin@2573

@slickgrid-universal/binding

npm i https://pkg.pr.new/@slickgrid-universal/binding@2573

@slickgrid-universal/common

npm i https://pkg.pr.new/@slickgrid-universal/common@2573

@slickgrid-universal/composite-editor-component

npm i https://pkg.pr.new/@slickgrid-universal/composite-editor-component@2573

@slickgrid-universal/custom-footer-component

npm i https://pkg.pr.new/@slickgrid-universal/custom-footer-component@2573

@slickgrid-universal/custom-tooltip-plugin

npm i https://pkg.pr.new/@slickgrid-universal/custom-tooltip-plugin@2573

@slickgrid-universal/empty-warning-component

npm i https://pkg.pr.new/@slickgrid-universal/empty-warning-component@2573

@slickgrid-universal/event-pub-sub

npm i https://pkg.pr.new/@slickgrid-universal/event-pub-sub@2573

@slickgrid-universal/excel-export

npm i https://pkg.pr.new/@slickgrid-universal/excel-export@2573

@slickgrid-universal/graphql

npm i https://pkg.pr.new/@slickgrid-universal/graphql@2573

@slickgrid-universal/odata

npm i https://pkg.pr.new/@slickgrid-universal/odata@2573

@slickgrid-universal/pagination-component

npm i https://pkg.pr.new/@slickgrid-universal/pagination-component@2573

@slickgrid-universal/pdf-export

npm i https://pkg.pr.new/@slickgrid-universal/pdf-export@2573

@slickgrid-universal/row-detail-view-plugin

npm i https://pkg.pr.new/@slickgrid-universal/row-detail-view-plugin@2573

@slickgrid-universal/rxjs-observable

npm i https://pkg.pr.new/@slickgrid-universal/rxjs-observable@2573

@slickgrid-universal/sql

npm i https://pkg.pr.new/@slickgrid-universal/sql@2573

@slickgrid-universal/text-export

npm i https://pkg.pr.new/@slickgrid-universal/text-export@2573

@slickgrid-universal/utils

npm i https://pkg.pr.new/@slickgrid-universal/utils@2573

@slickgrid-universal/vanilla-bundle

npm i https://pkg.pr.new/@slickgrid-universal/vanilla-bundle@2573

@slickgrid-universal/vanilla-force-bundle

npm i https://pkg.pr.new/@slickgrid-universal/vanilla-force-bundle@2573

commit: 07962af

@ghiscoding

ghiscoding commented May 7, 2026

Copy link
Copy Markdown
Owner Author

@zewa666 @jr01 this PR is another one of those vide coded fix by copilot for super old SlickGrid (6pac repo) issues, the issue was legit and the fix is now displaying the correct behavior. This might surprise some users, for example I was wrongly setting multiSelect: false in my Composite Editor demos and it now failed my tests, the new behavior is correct and it can't be disabled on Composite Editor because it does need multi-row selection (mass selection)... so FYI I'll be adding this warning:

⚠️ Breaking Change - multiSelect Option Now Properly Enforced

The multiSelect option is now properly respected. If you previously set multiSelect: false expecting it to work differently, this will now correctly enforce single-row-only selection. To allow multiple row selection while preventing the currently-active row from being automatically selected during navigation, use selectionOptions.selectActiveRow: false instead (keeping multiSelect at its default true).


This makes it clearer that selectActiveRow: false is specifically about navigation behavior (not auto-selecting as you arrow through rows), whereas multiSelect is about how many rows you can select in total.

@zewa666

zewa666 commented May 8, 2026

Copy link
Copy Markdown
Collaborator

thx a bunch for the heads up

@ghiscoding ghiscoding merged commit c684ea6 into master May 8, 2026
21 of 23 checks passed
@ghiscoding ghiscoding deleted the bugfix/row-selection-multiselect-false branch May 8, 2026 13:24
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

🎉 This pull request is included in version 10.7.0 📦
🔗 The release notes are available at: GitHub Release 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants